package club.banyuan.service;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileReader;

/**
 * @author edz
 * @version 1.0
 * @date 2020/12/19 下午5:24
 */
public class FileService {
    /**
     * 从文件读数据
     */
    public String read(String jsonFile) {
        try (BufferedReader br = new BufferedReader(new FileReader(jsonFile))) {
            String line;
            String json = "";
            while ((line = br.readLine()) != null) {
                json += line+"\n";
            }
            return json;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    public FileService() {
    }
}
